<?php

class ContactForm extends CFormModel {

    public $name;
    public $username;
    public $email;
    public $subject;
    public $body;
    public $verifyCode;

    public function rules() {
        return array(
            array('username, email, subject, body', 'required'),
            array('email', 'email'),
            array('verifyCode', 'captcha', 'allowEmpty' => !CCaptcha::checkRequirements()),
        );
    }

    public function attributeLabels() {
        return array(
            'name' => 'Your Name',
            'username' => 'Username',
            'email' => 'E-mail',
            'subject' => 'Subject',
            'body' => 'Detailed Question / Comment',
            'verifyCode' => 'Turing',
        );
    }

}